package online.liulei.design.mode;

/**
 * 装饰者类
 */
public class MochaDecorator implements Decorator{

    private Beverage beverage;

    public MochaDecorator(Beverage beverage){
        this.beverage =beverage;
    }

    @Override
    public double cost() {
        double mochaPrice = 1.1;
        return beverage.cost() + mochaPrice;
    }

    @Override
    public String description() {
        return beverage.description() + "摩卡配料>>";
    }
}
